/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pl.put.dcs.workManagerServer.config;


import org.apache.log4j.Logger;
/**
 *
 * @author LukaszR
 */
public class ServerConfigManager
{
    public static final String PATH_TO_SERVER_CONFIG = "config/server.properties";
    public static Logger log = Logger.getLogger( ServerConfigManager.class.getName() );
    private static ServerConfigManager instance = null;
    private ConfigManager config;

    private ServerConfigManager()
    {
        config = new ConfigManager( PATH_TO_SERVER_CONFIG );
    }

    public static String getProperty( String name )
    {
        return getInstance().getConfig().getProperty( name );
    }

    private ConfigManager getConfig()
    {
        return config;
    }


    private static ServerConfigManager getInstance()
    {
        if ( instance == null )
        {
            instance = new ServerConfigManager();
        }
        return instance;
    }

    public static int getMaxTaskForTaskWachdog()
    {
        return Integer.parseInt( getProperty( "maxTaskForTaskWachdog" ) );
    }

    public static String getInformationManagerHost()
    {
        return getProperty( "informationManagerHost" );
    }

    public static String getInformationManagerPort()
    {
        return getProperty( "informationManagerPort" );
    }

    public static String getProjectDeployDir()
    {
        return getProperty( "projectDeployDir" );
    }

    public static String getProjectLibPath()
    {
        return getProperty( "projectLibPath" );
    }
}
